= render :partial => 'show_image_list', :locals => { :photos => photos }

#image_list_pages.clear
  = paginate @photos, :per_page => 20

:javascript
  $('#image_list_pages a').click(remote_paginate);
  
  function remote_paginate(event){
    $('#dynamic_images_list').html("Loading images...<br /><img src='/assets/spinner.gif'>");
    element = $(this);
    $.ajax({
        url : element.attr('href'),
        type: 'GET',
        beforeSend: function(xhr, settings) {
            xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
        }    
    });
    event.stopPropagation();
    return false;
  }